﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using SpellCorrector;

namespace Tester
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        SpellCorrector.SpellCorrector corrector = new SpellCorrector.SpellCorrector();
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            int distance = Int32.Parse(txtDistance.Text);
            int max = Int32.Parse(txtMaxNumber.Text);
            lblSuggestedCorrections.Content = "";
            
            List<string> suggestedCorrections = corrector.CorrectWord(txtWordToCorrect.Text, distance, max);
            string output = "";
            foreach (string word in suggestedCorrections)
            {
                output = output + word + " ";
            }
            lblSuggestedCorrections.Content = output;
        }
    }
}
